//
//  MBScrollViewFooterTitleView.m
//  MobellCloud_ios
//
//  Created by cherry pu on 2017/12/28.
//  Copyright © 2017年 zhangXin. All rights reserved.
//

#import "MBScrollViewFooterTitleView.h"

@implementation MBScrollViewFooterTitleView

-(instancetype)init {
    if (self = [super init]) {
        
        [self mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(SCREEN_WIDTH);
            make.height.mas_equalTo([UIView lf_sizeFromIphone6:35]);
        }];
        
        UILabel* titleLabel = [[UILabel alloc]init];
        titleLabel.text = @"继续拖动，查看图文详情";
        titleLabel.font = [UIFont lf_systemFontOfSize:11];
        titleLabel.textColor = [UIColor colorWithWhite:0 alpha:0.8];
        [self addSubview:titleLabel];
        
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(self);
        }];
        
        UILabel* leftLine = [[UILabel alloc]init];
        leftLine.backgroundColor = [UIColor colorWithWhite:0 alpha:0.1];
        [self addSubview:leftLine];
        
        [leftLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).with.offset([UIView lf_sizeFromIphone6:10]);
            make.height.mas_equalTo([UIView lf_sizeFromIphone6:0.5]);
            make.right.equalTo(titleLabel.mas_left).with.offset([UIView lf_sizeFromIphone6:-10]);
            make.centerY.equalTo(self);
        }];
        
        UILabel* rightLine = [[UILabel alloc]init];
        rightLine.backgroundColor = leftLine.backgroundColor;
        [self addSubview:rightLine];
        
        [rightLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).with.offset([UIView lf_sizeFromIphone6:-10]);
            make.centerY.equalTo(self);
            make.height.mas_equalTo([UIView lf_sizeFromIphone6:0.5]);
            make.left.equalTo(titleLabel.mas_right).with.offset([UIView lf_sizeFromIphone6:10]);
        }];
        
    }
    return self;
}


@end
